#include "../HDomeControlPanelInstance.h"
#include "../HDomeControlPanel.h"
#include "../include/HGlobalVariable.h"
#include "../include/StdAfx.h"
#include "../include/HResolutionConfigResolver.h"
HDomeControlPanelInstance::HDomeControlPanelInstance(QObject *parent)
{
    HResolutionConfigResolver::dealResolutionConfigInfo(QApplication::applicationDirPath() + XMLRELATIONPATH + "resolutionConfig/mainConfig.xml");
}

HDomeControlPanelInstance::~HDomeControlPanelInstance()
{

}

QWidget *HDomeControlPanelInstance::createWidget()
{
    m_pwndDomeControlPanel = new HDomeControlPanel(NULL);
    QSize screenSize = QApplication::primaryScreen()->size();

    m_pwndDomeControlPanel->setMaximumSize(screenSize);
    return m_pwndDomeControlPanel;
}

void HDomeControlPanelInstance::iniWidget()
{
	m_pwndDomeControlPanel->iniScenesOpenVideo();
}

void HDomeControlPanelInstance::setAppPath(QString strAppPath)
{
    g_strAppPath = strAppPath;
}

void HDomeControlPanelInstance::updateTreeUI(QList<HTTreeItemInfo*> lstItemInfos)
{
    m_pwndDomeControlPanel->updateTreeUI(lstItemInfos);
}

void HDomeControlPanelInstance::appendTreeItem(HTTreeItemInfo* itemInfo)
{
	m_pwndDomeControlPanel->appendTreeItem(itemInfo);
}

void HDomeControlPanelInstance::setTaskID(int nTaskID)
{
	m_pwndDomeControlPanel->setTaskID(nTaskID);
}

void HDomeControlPanelInstance::setPanelResolution(int nVideoID,QString strResolution)
{
    m_pwndDomeControlPanel->setPanelResolution(nVideoID,strResolution);
}

void HDomeControlPanelInstance::setDeviceWarning(int nVideoID)
{
    m_pwndDomeControlPanel->setDeviceWarning(nVideoID);
}
